gdk: Remove testing functions
authorBenjamin Otte <otte@redhat.com>
Sun, 8 Jan 2017 02:34:58 +0000 (03:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 8 Jan 2017 02:46:30 +0000 (03:46 +0100)
They were unused and unimplemented.

24 files changed:
docs/reference/gdk/gdk4-sections.txt
gdk/Makefile.am
gdk/broadway/Makefile.am
gdk/broadway/gdkprivate-broadway.h
gdk/broadway/gdktestutils-broadway.c [deleted file]
gdk/broadway/gdkwindow-broadway.c
gdk/gdk.h
gdk/gdktestutils.h [deleted file]
gdk/gdkwindow.c
gdk/gdkwindowimpl.h
gdk/mir/gdkmirwindowimpl.c
gdk/quartz/Makefile.am
gdk/quartz/gdkprivate-quartz.h
gdk/quartz/gdktestutils-quartz.c [deleted file]
gdk/quartz/gdkwindow-quartz.c
gdk/wayland/gdkwindow-wayland.c
gdk/win32/Makefile.am
gdk/win32/gdkprivate-win32.h
gdk/win32/gdktestutils-win32.c [deleted file]
gdk/win32/gdkwindow-win32.c
gdk/x11/Makefile.am
gdk/x11/gdkprivate-x11.h
gdk/x11/gdktestutils-x11.c [deleted file]
gdk/x11/gdkwindow-x11.c

index e50788113eefee52067060b578a99c3900ff9536..0eec4fe112da1219c75dea3a40dd27cb415ea66a 100644 (file)
@@ -1217,14 +1217,6 @@ GdkAppLaunchContextClass
 gdk_app_launch_context_get_type
 </SECTION>
 
-<SECTION>
-<TITLE>Testing</TITLE>
-<FILE>gdktestutils</FILE>
-gdk_test_render_sync
-gdk_test_simulate_button
-gdk_test_simulate_key
-</SECTION>
-
 <SECTION>
 <TITLE>GdkFrameClock</TITLE>
 <FILE>gdkframeclock</FILE>
index f40ffc778eaf02c47464bfca23bef5da97e7320c..064fe39fb24bf1866b82e0731050d7dd5dbf5c85 100644 (file)
@@ -87,7 +87,6 @@ gdk_public_h_sources =                                \
        gdkscreen.h                             \
        gdkseat.h                               \
        gdkselection.h                          \
-       gdktestutils.h                          \
        gdkthreads.h                            \
        gdktypes.h                              \
        gdkvisual.h                             \
@@ -264,7 +263,6 @@ x11_introspection_files =           \
        x11/gdkscreen-x11.c             \
        x11/gdkselection-x11.c          \
        x11/gdksettings.c               \
-       x11/gdktestutils-x11.c          \
        x11/gdkvisual-x11.c             \
        x11/gdkwindow-x11.c             \
        x11/gdkxftdefaults.c            \
@@ -321,7 +319,6 @@ w32_introspection_files =           \
        win32/gdkproperty-win32.c       \
        win32/gdkscreen-win32.c         \
        win32/gdkselection-win32.c      \
-       win32/gdktestutils-win32.c      \
        win32/gdkwin32.h                \
        win32/gdkwin32cursor.h          \
        win32/gdkwin32display.h         \
index 47e6ed3806779cd7dca9491647d896925af24065..05fd5b1e6ff8d1545237f35f608191b4412e285b 100644 (file)
@@ -71,7 +71,6 @@ libgdk_broadway_la_SOURCES =          \
        gdkscreen-broadway.c    \
        gdkscreen-broadway.h    \
        gdkselection-broadway.c \
-       gdktestutils-broadway.c \
        gdkwindow-broadway.c    \
        gdkwindow-broadway.h    \
        gdkprivate-broadway.h   \
index b5710cfe49236ff892528da465596130af3dc897..4e56071b6f10f2b6a6abae064660cb4e22c02532 100644 (file)
@@ -161,19 +161,6 @@ BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display,
                                                          gboolean remove);
 
 /* Window methods - testing */
-void     _gdk_broadway_window_sync_rendering    (GdkWindow       *window);
-gboolean _gdk_broadway_window_simulate_key      (GdkWindow       *window,
-                                                gint             x,
-                                                gint             y,
-                                                guint            keyval,
-                                                GdkModifierType  modifiers,
-                                                GdkEventType     key_pressrelease);
-gboolean _gdk_broadway_window_simulate_button   (GdkWindow       *window,
-                                                gint             x,
-                                                gint             y,
-                                                guint            button,
-                                                GdkModifierType  modifiers,
-                                                GdkEventType     button_pressrelease);
 void _gdk_broadway_window_resize_surface        (GdkWindow *window);
 
 void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
diff --git a/gdk/broadway/gdktestutils-broadway.c b/gdk/broadway/gdktestutils-broadway.c
deleted file mode 100644 (file)
index a3b1ee2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Gtk+ testing utilities
- * Copyright (C) 2007 Imendio AB
- * Authors: Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-#include "config.h"
-#include <gdk/gdktestutils.h>
-#include <gdk/gdkkeysyms.h>
-#include <gdk/gdkinternals.h>
-#include "gdkprivate-broadway.h"
-
-void
-_gdk_broadway_window_sync_rendering (GdkWindow *window)
-{
-  /* FIXME: Find out if there is a way to implement this on broadway. */
-}
-
-gboolean
-_gdk_broadway_window_simulate_key (GdkWindow      *window,
-                                  gint            x,
-                                  gint            y,
-                                  guint           keyval,
-                                  GdkModifierType modifiers,
-                                  GdkEventType    key_pressrelease)
-{
-  g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  /* FIXME: Implement. */
-
-  return FALSE;
-}
-
-gboolean
-_gdk_broadway_window_simulate_button (GdkWindow      *window,
-                                     gint            x,
-                                     gint            y,
-                                     guint           button, /*1..3*/
-                                     GdkModifierType modifiers,
-                                     GdkEventType    button_pressrelease)
-{
-  g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  /* FIXME: Implement. */
-
-  return FALSE;
-}
index 4701568be03958014d80f4863629f7a8be384c24..0967ffe6118d28a0628a8486d9e278ecfca2df19 100644 (file)
@@ -1534,9 +1534,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
   impl_class->destroy_notify = gdk_broadway_window_destroy_notify;
   impl_class->register_dnd = _gdk_broadway_window_register_dnd;
   impl_class->drag_begin = _gdk_broadway_window_drag_begin;
-  impl_class->sync_rendering = _gdk_broadway_window_sync_rendering;
-  impl_class->simulate_key = _gdk_broadway_window_simulate_key;
-  impl_class->simulate_button = _gdk_broadway_window_simulate_button;
   impl_class->get_property = _gdk_broadway_window_get_property;
   impl_class->change_property = _gdk_broadway_window_change_property;
   impl_class->delete_property = _gdk_broadway_window_delete_property;
index 4f6c4c478503a817969621a2e1795608d1196fb9..8bed08072ceef18a2d4f946a525a9cb0f73108d7 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -58,7 +58,6 @@
 #include <gdk/gdkscreen.h>
 #include <gdk/gdkseat.h>
 #include <gdk/gdkselection.h>
-#include <gdk/gdktestutils.h>
 #include <gdk/gdkthreads.h>
 #include <gdk/gdktypes.h>
 #include <gdk/gdkvisual.h>
diff --git a/gdk/gdktestutils.h b/gdk/gdktestutils.h
deleted file mode 100644 (file)
index ebccb56..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Gdk testing utilities
- * Copyright (C) 2007 Imendio AB
- * Authors: Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GDK_TEST_UTILS_H__
-#define __GDK_TEST_UTILS_H__
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only <gdk/gdk.h> can be included directly."
-#endif
-
-#include <gdk/gdkwindow.h>
-
-G_BEGIN_DECLS
-
-
-/**
- * SECTION:gdktestutils
- * @Short_description: Test utilities
- * @Title: Testing
- *
- * The functions in this section are intended to be used in test programs.
- * They allow to simulate some user input.
- */
-
-
-/* --- Gdk Test Utility API --- */
-GDK_AVAILABLE_IN_ALL
-void            gdk_test_render_sync            (GdkWindow      *window);
-GDK_AVAILABLE_IN_ALL
-gboolean        gdk_test_simulate_key           (GdkWindow      *window,
-                                                 gint            x,
-                                                 gint            y,
-                                                 guint           keyval,
-                                                 GdkModifierType modifiers,
-                                                 GdkEventType    key_pressrelease);
-GDK_AVAILABLE_IN_ALL
-gboolean        gdk_test_simulate_button        (GdkWindow      *window,
-                                                 gint            x,
-                                                 gint            y,
-                                                 guint           button, /*1..3*/
-                                                 GdkModifierType modifiers,
-                                                 GdkEventType    button_pressrelease);
-
-G_END_DECLS
-
-#endif /* __GDK_TEST_UTILS_H__ */
index b761c490d615b5257f4d32711586126adae61c7e..6dffc61175cedc7b61196ef63edc5ed68130eef2 100644 (file)
@@ -8930,106 +8930,6 @@ gdk_drag_begin_from_point (GdkWindow *window,
   return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->drag_begin (window, device, targets, x_root, y_root);
 }
 
-/**
- * gdk_test_render_sync:
- * @window: a mapped #GdkWindow
- *
- * Retrieves a pixel from @window to force the windowing
- * system to carry out any pending rendering commands.
- *
- * This function is intended to be used to synchronize with rendering
- * pipelines, to benchmark windowing system rendering operations.
- *
- * Since: 2.14
- **/
-void
-gdk_test_render_sync (GdkWindow *window)
-{
-  GDK_WINDOW_IMPL_GET_CLASS (window->impl)->sync_rendering (window);
-}
-
-/**
- * gdk_test_simulate_key:
- * @window: a #GdkWindow to simulate a key event for
- * @x:      x coordinate within @window for the key event
- * @y:      y coordinate within @window for the key event
- * @keyval: A GDK keyboard value
- * @modifiers: Keyboard modifiers the event is setup with
- * @key_pressrelease: either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
- *
- * This function is intended to be used in GTK+ test programs.
- * If (@x,@y) are > (-1,-1), it will warp the mouse pointer to
- * the given (@x,@y) coordinates within @window and simulate a
- * key press or release event.
- *
- * When the mouse pointer is warped to the target location, use
- * of this function outside of test programs that run in their
- * own virtual windowing system (e.g. Xvfb) is not recommended.
- * If (@x,@y) are passed as (-1,-1), the mouse pointer will not
- * be warped and @window origin will be used as mouse pointer
- * location for the event.
- *
- * Also, gdk_test_simulate_key() is a fairly low level function,
- * for most testing purposes, gtk_test_widget_send_key() is the
- * right function to call which will generate a key press event
- * followed by its accompanying key release event.
- *
- * Returns: whether all actions necessary for a key event simulation
- *     were carried out successfully
- *
- * Since: 2.14
- */
-gboolean
-gdk_test_simulate_key (GdkWindow      *window,
-                       gint            x,
-                       gint            y,
-                       guint           keyval,
-                       GdkModifierType modifiers,
-                       GdkEventType    key_pressrelease)
-{
-  return GDK_WINDOW_IMPL_GET_CLASS (window->impl)
-    ->simulate_key (window, x, y, keyval, modifiers, key_pressrelease);
-}
-
-/**
- * gdk_test_simulate_button:
- * @window: a #GdkWindow to simulate a button event for
- * @x:      x coordinate within @window for the button event
- * @y:      y coordinate within @window for the button event
- * @button: Number of the pointer button for the event, usually 1, 2 or 3
- * @modifiers: Keyboard modifiers the event is setup with
- * @button_pressrelease: either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE
- *
- * This function is intended to be used in GTK+ test programs.
- * It will warp the mouse pointer to the given (@x,@y) coordinates
- * within @window and simulate a button press or release event.
- * Because the mouse pointer needs to be warped to the target
- * location, use of this function outside of test programs that
- * run in their own virtual windowing system (e.g. Xvfb) is not
- * recommended.
- *
-* Also, gdk_test_simulate_button() is a fairly low level function,
- * for most testing purposes, gtk_test_widget_click() is the right
- * function to call which will generate a button press event followed
- * by its accompanying button release event.
- *
- * Returns: whether all actions necessary for a button event simulation
- *     were carried out successfully
- *
- * Since: 2.14
- */
-gboolean
-gdk_test_simulate_button (GdkWindow      *window,
-                          gint            x,
-                          gint            y,
-                          guint           button, /*1..3*/
-                          GdkModifierType modifiers,
-                          GdkEventType    button_pressrelease)
-{
-  return GDK_WINDOW_IMPL_GET_CLASS (window->impl)
-    ->simulate_button (window, x, y, button, modifiers, button_pressrelease);
-}
-
 /**
  * gdk_property_get:
  * @window: a #GdkWindow
index cdfe36f59eb22bb69c9422aca975021407bd69c9..6d7637951bf664fd9f73fd1f007a75fbbd9f9d87 100644 (file)
@@ -231,20 +231,6 @@ struct _GdkWindowImplClass
   void         (*process_updates_recurse) (GdkWindow      *window,
                                            cairo_region_t *region);
 
-  void         (*sync_rendering)          (GdkWindow      *window);
-  gboolean     (*simulate_key)            (GdkWindow      *window,
-                                           gint            x,
-                                           gint            y,
-                                           guint           keyval,
-                                           GdkModifierType modifiers,
-                                           GdkEventType    event_type);
-  gboolean     (*simulate_button)         (GdkWindow      *window,
-                                           gint            x,
-                                           gint            y,
-                                           guint           button,
-                                           GdkModifierType modifiers,
-                                           GdkEventType    event_type);
-
   gboolean     (*get_property)            (GdkWindow      *window,
                                            GdkAtom         property,
                                            GdkAtom         type,
index b00e35eba5fad43cf66db860a16b8f57dff41e63..1939e7fb6d09f079974decd40c5bd1d874e4b3cb 100644 (file)
@@ -1400,37 +1400,6 @@ gdk_mir_window_impl_process_updates_recurse (GdkWindow      *window,
   _gdk_window_process_updates_recurse (window, region);
 }
 
-static void
-gdk_mir_window_impl_sync_rendering (GdkWindow *window)
-{
-  //g_printerr ("gdk_mir_window_impl_sync_rendering window=%p\n", window);
-  // FIXME: Only used for benchmarking
-}
-
-static gboolean
-gdk_mir_window_impl_simulate_key (GdkWindow       *window,
-                                  gint             x,
-                                  gint             y,
-                                  guint            keyval,
-                                  GdkModifierType  modifiers,
-                                  GdkEventType     key_pressrelease)
-{
-  //g_printerr ("gdk_mir_window_impl_simulate_key window=%p\n", window);
-  return FALSE;
-}
-
-static gboolean
-gdk_mir_window_impl_simulate_button (GdkWindow       *window,
-                                     gint             x,
-                                     gint             y,
-                                     guint            button,
-                                     GdkModifierType  modifiers,
-                                     GdkEventType     button_pressrelease)
-{
-  //g_printerr ("gdk_mir_window_impl_simulate_button window=%p\n", window);
-  return FALSE;
-}
-
 static gboolean
 gdk_mir_window_impl_get_property (GdkWindow  *window,
                                   GdkAtom     property,
@@ -2007,9 +1976,6 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
   impl_class->register_dnd = gdk_mir_window_impl_register_dnd;
   impl_class->drag_begin = gdk_mir_window_impl_drag_begin;
   impl_class->process_updates_recurse = gdk_mir_window_impl_process_updates_recurse;
-  impl_class->sync_rendering = gdk_mir_window_impl_sync_rendering;
-  impl_class->simulate_key = gdk_mir_window_impl_simulate_key;
-  impl_class->simulate_button = gdk_mir_window_impl_simulate_button;
   impl_class->get_property = gdk_mir_window_impl_get_property;
   impl_class->change_property = gdk_mir_window_impl_change_property;
   impl_class->delete_property = gdk_mir_window_impl_delete_property;
index eda5263f72fde998bf3fa2d3844fd6a3aadcc1bb..43b8eeedbcca107dde21e0e3d37c4427b4b4288e 100644 (file)
@@ -44,7 +44,6 @@ libgdk_quartz_la_SOURCES =            \
        gdkscreen-quartz.c      \
        gdkscreen-quartz.h      \
        gdkselection-quartz.c   \
-       gdktestutils-quartz.c   \
        gdkutils-quartz.c       \
        gdkwindow-quartz.c      \
        gdkwindow-quartz.h      \
index 7fcb2cbecaa054e891633a55e7b15cc8e8d4d9f7..576cac9de48cfc296b35ec4370a32482ad7cb05a 100644 (file)
@@ -194,21 +194,6 @@ void       _gdk_quartz_window_debug_highlight       (GdkWindow *window,
 void       _gdk_quartz_window_update_position           (GdkWindow    *window);
 void       _gdk_quartz_window_update_fullscreen_state   (GdkWindow    *window);
 
-/* Window methods - testing */
-void     _gdk_quartz_window_sync_rendering    (GdkWindow       *window);
-gboolean _gdk_quartz_window_simulate_key      (GdkWindow       *window,
-                                               gint             x,
-                                               gint             y,
-                                               guint            keyval,
-                                               GdkModifierType  modifiers,
-                                               GdkEventType     key_pressrelease);
-gboolean _gdk_quartz_window_simulate_button   (GdkWindow       *window,
-                                               gint             x,
-                                               gint             y,
-                                               guint            button,
-                                               GdkModifierType  modifiers,
-                                               GdkEventType     button_pressrelease);
-
 /* Window methods - property */
 gboolean _gdk_quartz_window_get_property      (GdkWindow    *window,
                                                GdkAtom       property,
diff --git a/gdk/quartz/gdktestutils-quartz.c b/gdk/quartz/gdktestutils-quartz.c
deleted file mode 100644 (file)
index ad23661..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Gtk+ testing utilities
- * Copyright (C) 2007 Imendio AB
- * Authors: Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-#include "config.h"
-#include <gdk/gdktestutils.h>
-#include <gdk/gdkkeysyms.h>
-#include <gdk/gdkinternals.h>
-
-void
-_gdk_quartz_window_sync_rendering (GdkWindow *window)
-{
-  /* FIXME: Find out if there is a way to implement this on quartz. */
-}
-
-gboolean
-_gdk_quartz_window_simulate_key (GdkWindow      *window,
-                                 gint            x,
-                                 gint            y,
-                                 guint           keyval,
-                                 GdkModifierType modifiers,
-                                 GdkEventType    key_pressrelease)
-{
-  g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  /* FIXME: Implement. */
-
-  return FALSE;
-}
-
-gboolean
-_gdk_quartz_window_simulate_button (GdkWindow      *window,
-                                    gint            x,
-                                    gint            y,
-                                    guint           button, /*1..3*/
-                                    GdkModifierType modifiers,
-                                    GdkEventType    button_pressrelease)
-{
-  g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  /* FIXME: Implement. */
-
-  return FALSE;
-}
index e853a834875053e90a5c02c954bff14898a70223..515a779aec03917f3d9f7f646ab2f771612e4ab0 100644 (file)
@@ -2791,9 +2791,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
   impl_class->register_dnd = _gdk_quartz_window_register_dnd;
   impl_class->drag_begin = _gdk_quartz_window_drag_begin;
   impl_class->process_updates_recurse = _gdk_quartz_window_process_updates_recurse;
-  impl_class->sync_rendering = _gdk_quartz_window_sync_rendering;
-  impl_class->simulate_key = _gdk_quartz_window_simulate_key;
-  impl_class->simulate_button = _gdk_quartz_window_simulate_button;
   impl_class->get_property = _gdk_quartz_window_get_property;
   impl_class->change_property = _gdk_quartz_window_change_property;
   impl_class->delete_property = _gdk_quartz_window_delete_property;
index 823fc3bef2066d2989f59dafda2212e2cc987f12..466f7c3c723521ef97f1c7ea6b596bef2efc2eee 100644 (file)
@@ -3422,33 +3422,6 @@ gdk_wayland_window_destroy_notify (GdkWindow *window)
   g_object_unref (window);
 }
 
-static void
-gdk_wayland_window_sync_rendering (GdkWindow *window)
-{
-}
-
-static gboolean
-gdk_wayland_window_simulate_key (GdkWindow       *window,
-                                 gint             x,
-                                 gint             y,
-                                 guint            keyval,
-                                 GdkModifierType  modifiers,
-                                 GdkEventType     key_pressrelease)
-{
-  return FALSE;
-}
-
-static gboolean
-gdk_wayland_window_simulate_button (GdkWindow       *window,
-                                    gint             x,
-                                    gint             y,
-                                    guint            button,
-                                    GdkModifierType  modifiers,
-                                    GdkEventType     button_pressrelease)
-{
-  return FALSE;
-}
-
 static gboolean
 gdk_wayland_window_get_property (GdkWindow   *window,
                                  GdkAtom      property,
@@ -3639,9 +3612,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
   impl_class->get_drag_protocol = _gdk_wayland_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_wayland_window_register_dnd;
   impl_class->drag_begin = _gdk_wayland_window_drag_begin;
-  impl_class->sync_rendering = gdk_wayland_window_sync_rendering;
-  impl_class->simulate_key = gdk_wayland_window_simulate_key;
-  impl_class->simulate_button = gdk_wayland_window_simulate_button;
   impl_class->get_property = gdk_wayland_window_get_property;
   impl_class->change_property = gdk_wayland_window_change_property;
   impl_class->delete_property = gdk_wayland_window_delete_property;
index 4497429c8a1e38231f2b04a83c0d8fa4702a86b1..991dc9e3bc419eb265449a0f783e149b2915141f 100644 (file)
@@ -54,7 +54,6 @@ libgdk_win32_la_SOURCES = \
        gdkproperty-win32.c \
        gdkscreen-win32.c \
        gdkselection-win32.c \
-       gdktestutils-win32.c \
        gdkvulkancontext-win32.c \
        gdkvulkancontext-win32.h \
        gdkwin32cursor.h \
index f2c5b3be8574e608f32083262aab8e6bfc7054c7..ef51184be13c0918fcc5255f8724ce730e682d7e 100644 (file)
@@ -481,18 +481,6 @@ void       _gdk_win32_display_create_window_impl   (GdkDisplay    *display,
 /* stray GdkWindowImplWin32 members */
 void _gdk_win32_window_register_dnd (GdkWindow *window);
 GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root);
-gboolean _gdk_win32_window_simulate_key (GdkWindow      *window,
-                                 gint            x,
-                                 gint            y,
-                                 guint           keyval,
-                                 GdkModifierType modifiers,
-                                 GdkEventType    key_pressrelease);
-gboolean _gdk_win32_window_simulate_button (GdkWindow      *window,
-                                    gint            x,
-                                    gint            y,
-                                    guint           button, /*1..3*/
-                                    GdkModifierType modifiers,
-                                    GdkEventType    button_pressrelease);
 
 gint _gdk_win32_window_get_property (GdkWindow   *window,
                                     GdkAtom      property,
diff --git a/gdk/win32/gdktestutils-win32.c b/gdk/win32/gdktestutils-win32.c
deleted file mode 100644 (file)
index 6e4729d..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Gtk+ testing utilities
- * Copyright (C) 2007 Imendio AB
- * Authors: Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-#include "config.h"
-
-#include <gdk/gdktestutils.h>
-#include <gdk/gdkkeysyms.h>
-#include <win32/gdkwin32.h>
-
-
-gboolean
-_gdk_win32_window_simulate_key (GdkWindow      *window,
-                       gint            x,
-                       gint            y,
-                       guint           keyval,
-                       GdkModifierType modifiers,
-                       GdkEventType    key_pressrelease)
-{
-  gboolean      success = FALSE;
-  GdkKeymapKey *keys    = NULL;
-  gint          n_keys  = 0;
-  INPUT         ip;
-  gint          i;
-
-  g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  ip.type = INPUT_KEYBOARD;
-  ip.ki.wScan = 0;
-  ip.ki.time = 0;
-  ip.ki.dwExtraInfo = 0;
-
-  switch (key_pressrelease)
-    {
-    case GDK_KEY_PRESS:
-      ip.ki.dwFlags = 0;
-      break;
-    case GDK_KEY_RELEASE:
-      ip.ki.dwFlags = KEYEVENTF_KEYUP;
-      break;
-    default:
-      /* Not a key event. */
-      return FALSE;
-    }
-  if (gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (), keyval, &keys, &n_keys))
-    {
-      for (i = 0; i < n_keys; i++)
-        {
-          if (key_pressrelease == GDK_KEY_PRESS)
-            {
-              /* AltGr press. */
-              if (keys[i].group)
-                {
-                  /* According to some virtualbox code I found, AltGr is
-                   * simulated on win32 with LCtrl+RAlt */
-                  ip.ki.wVk = VK_CONTROL;
-                  SendInput(1, &ip, sizeof(INPUT));
-                  ip.ki.wVk = VK_MENU;
-                  SendInput(1, &ip, sizeof(INPUT));
-                }
-              /* Shift press. */
-              if (keys[i].level || (modifiers & GDK_SHIFT_MASK))
-                {
-                  ip.ki.wVk = VK_SHIFT;
-                  SendInput(1, &ip, sizeof(INPUT));
-                }
-            }
-
-          /* Key pressed/released. */
-          ip.ki.wVk = keys[i].keycode;
-          SendInput(1, &ip, sizeof(INPUT));
-
-          if (key_pressrelease == GDK_KEY_RELEASE)
-            {
-              /* Shift release. */
-              if (keys[i].level || (modifiers & GDK_SHIFT_MASK))
-                {
-                  ip.ki.wVk = VK_SHIFT;
-                  SendInput(1, &ip, sizeof(INPUT));
-                }
-              /* AltrGr release. */
-              if (keys[i].group)
-                {
-                  ip.ki.wVk = VK_MENU;
-                  SendInput(1, &ip, sizeof(INPUT));
-                  ip.ki.wVk = VK_CONTROL;
-                  SendInput(1, &ip, sizeof(INPUT));
-                }
-            }
-
-          /* No need to loop for alternative keycodes. We want only one
-           * key generated. */
-          success = TRUE;
-          break;
-        }
-      g_free (keys);
-    }
-  return success;
-}
-
-gboolean
-_gdk_win32_window_simulate_button (GdkWindow      *window,
-                          gint            x,
-                          gint            y,
-                          guint           button, /*1..3*/
-                          GdkModifierType modifiers,
-                          GdkEventType    button_pressrelease)
-{
-  g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  return FALSE;
-}
index 7466f58cd1d29fe7d261c2cd4345567befa19fbe..a545611d744f6f52fc46f997f7602c83519603de 100644 (file)
@@ -5939,9 +5939,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
   impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_win32_window_register_dnd;
   impl_class->drag_begin = _gdk_win32_window_drag_begin;
-  //? impl_class->sync_rendering = _gdk_win32_window_sync_rendering;
-  impl_class->simulate_key = _gdk_win32_window_simulate_key;
-  impl_class->simulate_button = _gdk_win32_window_simulate_button;
   impl_class->get_property = _gdk_win32_window_get_property;
   impl_class->change_property = _gdk_win32_window_change_property;
   impl_class->delete_property = _gdk_win32_window_delete_property;
index d1f6df81379173eda6ce071fe16c247fa1be7a6d..f318ef3cf9bbac6d9ed6c82f7c86dccc0fe0da32 100644 (file)
@@ -50,7 +50,6 @@ libgdk_x11_la_SOURCES =       \
        gdkscreen-x11.c         \
        gdkscreen-x11.h         \
        gdkselection-x11.c      \
-       gdktestutils-x11.c      \
        gdkvisual-x11.c         \
        gdkvulkancontext-x11.c  \
        gdkvulkancontext-x11.h  \
index ce6a9e69ff3c2748bf5c9ccfc3d60e2469de4c99..30a388f0b2f14cda8844fcc20f5cf41c27ef4c47 100644 (file)
@@ -74,19 +74,6 @@ void _gdk_x11_window_process_expose    (GdkWindow     *window,
                                         gulong         serial,
                                         GdkRectangle  *area);
 
-void     _gdk_x11_window_sync_rendering    (GdkWindow       *window);
-gboolean _gdk_x11_window_simulate_key      (GdkWindow       *window,
-                                            gint             x,
-                                            gint             y,
-                                            guint            keyval,
-                                            GdkModifierType  modifiers,
-                                            GdkEventType     key_pressrelease);
-gboolean _gdk_x11_window_simulate_button   (GdkWindow       *window,
-                                            gint             x,
-                                            gint             y,
-                                            guint            button,
-                                            GdkModifierType  modifiers,
-                                            GdkEventType     button_pressrelease);
 gboolean _gdk_x11_window_get_property      (GdkWindow    *window,
                                             GdkAtom       property,
                                             GdkAtom       type,
diff --git a/gdk/x11/gdktestutils-x11.c b/gdk/x11/gdktestutils-x11.c
deleted file mode 100644 (file)
index 9ef4439..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Gtk+ testing utilities
- * Copyright (C) 2007 Imendio AB
- * Authors: Tim Janik
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "config.h"
-
-#include "gdktestutils.h"
-
-#include "gdkkeysyms.h"
-#include "gdkprivate-x11.h"
-
-#include <X11/Xlib.h>
-
-void
-_gdk_x11_window_sync_rendering (GdkWindow *window)
-{
-  Display *display = GDK_WINDOW_XDISPLAY (window);
-  XImage *ximage;
-
-  /* syncronize to X drawing queue, see:
-   * http://mail.gnome.org/archives/gtk-devel-list/2006-October/msg00103.html
-   */
-  ximage = XGetImage (display, DefaultRootWindow (display),
-                     0, 0, 1, 1, AllPlanes, ZPixmap);
-  if (ximage != NULL)
-    XDestroyImage (ximage);
-}
-
-gboolean
-_gdk_x11_window_simulate_key (GdkWindow      *window,
-                              gint            x,
-                              gint            y,
-                              guint           keyval,
-                              GdkModifierType modifiers,
-                              GdkEventType    key_pressrelease)
-{
-  GdkScreen *screen;
-  GdkKeymapKey *keys = NULL;
-  gboolean success;
-  gint n_keys = 0;
-  XKeyEvent xev = {
-    0,  /* type */
-    0,  /* serial */
-    1,  /* send_event */
-  };
-  g_return_val_if_fail (key_pressrelease == GDK_KEY_PRESS || key_pressrelease == GDK_KEY_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  screen = gdk_window_get_screen (window);
-
-  if (x < 0 && y < 0)
-    {
-      x = window->width / 2;
-      y = window->height / 2;
-    }
-
-  /* Convert to impl coordinates */
-  x = x + window->abs_x;
-  y = y + window->abs_y;
-
-  xev.type = key_pressrelease == GDK_KEY_PRESS ? KeyPress : KeyRelease;
-  xev.display = GDK_WINDOW_XDISPLAY (window);
-  xev.window = GDK_WINDOW_XID (window);
-  xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num);
-  xev.subwindow = 0;
-  xev.time = 0;
-  xev.x = MAX (x, 0);
-  xev.y = MAX (y, 0);
-  xev.x_root = 0;
-  xev.y_root = 0;
-  xev.state = modifiers;
-  xev.keycode = 0;
-  success = gdk_keymap_get_entries_for_keyval (gdk_keymap_get_for_display (gdk_window_get_display (window)), keyval, &keys, &n_keys);
-  success &= n_keys > 0;
-  if (success)
-    {
-      gint i;
-      for (i = 0; i < n_keys; i++)
-        if (keys[i].group == 0 && (keys[i].level == 0 || keys[i].level == 1))
-          {
-            xev.keycode = keys[i].keycode;
-            if (keys[i].level == 1)
-              {
-                /* Assume shift takes us to level 1 */
-                xev.state |= GDK_SHIFT_MASK;
-              }
-            break;
-          }
-      if (i >= n_keys) /* no match for group==0 and level==0 or 1 */
-        xev.keycode = keys[0].keycode;
-    }
-  g_free (keys);
-  if (!success)
-    return FALSE;
-  gdk_x11_display_error_trap_push (GDK_WINDOW_DISPLAY (window));
-  xev.same_screen = XTranslateCoordinates (xev.display, xev.window, xev.root,
-                                           xev.x, xev.y, &xev.x_root, &xev.y_root,
-                                           &xev.subwindow);
-  if (!xev.subwindow)
-    xev.subwindow = xev.window;
-  success &= xev.same_screen;
-  if (x >= 0 && y >= 0)
-    success &= 0 != XWarpPointer (xev.display, None, xev.window, 0, 0, 0, 0, xev.x, xev.y);
-  success &= 0 != XSendEvent (xev.display, xev.window, True, key_pressrelease == GDK_KEY_PRESS ? KeyPressMask : KeyReleaseMask, (XEvent*) &xev);
-  XSync (xev.display, False);
-  success &= 0 == gdk_x11_display_error_trap_pop (GDK_WINDOW_DISPLAY (window));
-  return success;
-}
-
-gboolean
-_gdk_x11_window_simulate_button (GdkWindow      *window,
-                                 gint            x,
-                                 gint            y,
-                                 guint           button, /*1..3*/
-                                 GdkModifierType modifiers,
-                                 GdkEventType    button_pressrelease)
-{
-  GdkScreen *screen;
-  XButtonEvent xev = {
-    0,  /* type */
-    0,  /* serial */
-    1,  /* send_event */
-  };
-  gboolean success;
-
-  g_return_val_if_fail (button_pressrelease == GDK_BUTTON_PRESS || button_pressrelease == GDK_BUTTON_RELEASE, FALSE);
-  g_return_val_if_fail (window != NULL, FALSE);
-
-  if (!GDK_WINDOW_IS_MAPPED (window))
-    return FALSE;
-
-  screen = gdk_window_get_screen (window);
-
-  if (x < 0 && y < 0)
-    {
-      x = window->width / 2;
-      y = window->height / 2;
-    }
-
-  /* Convert to impl coordinates */
-  x = x + window->abs_x;
-  y = y + window->abs_y;
-
-  xev.type = button_pressrelease == GDK_BUTTON_PRESS ? ButtonPress : ButtonRelease;
-  xev.display = GDK_WINDOW_XDISPLAY (window);
-  xev.window = GDK_WINDOW_XID (window);
-  xev.root = RootWindow (xev.display, GDK_X11_SCREEN (screen)->screen_num);
-  xev.subwindow = 0;
-  xev.time = 0;
-  xev.x = x;
-  xev.y = y;
-  xev.x_root = 0;
-  xev.y_root = 0;
-  xev.state = modifiers;
-  xev.button = button;
-  gdk_x11_display_error_trap_push (GDK_WINDOW_DISPLAY (window));
-  xev.same_screen = XTranslateCoordinates (xev.display, xev.window, xev.root,
-                                           xev.x, xev.y, &xev.x_root, &xev.y_root,
-                                           &xev.subwindow);
-  if (!xev.subwindow)
-    xev.subwindow = xev.window;
-  success = xev.same_screen;
-  success &= 0 != XWarpPointer (xev.display, None, xev.window, 0, 0, 0, 0, xev.x, xev.y);
-  success &= 0 != XSendEvent (xev.display, xev.window, True, button_pressrelease == GDK_BUTTON_PRESS ? ButtonPressMask : ButtonReleaseMask, (XEvent*) &xev);
-  XSync (xev.display, False);
-  success &= 0 == gdk_x11_display_error_trap_pop(GDK_WINDOW_DISPLAY (window));
-  return success;
-}
index e00c0186c800ea22ee7a791b0233088118404b18..661b5cc86edd4bbcc5a35b0f7a8695da5ffc69f9 100644 (file)
@@ -5105,9 +5105,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
   impl_class->register_dnd = _gdk_x11_window_register_dnd;
   impl_class->drag_begin = _gdk_x11_window_drag_begin;
-  impl_class->sync_rendering = _gdk_x11_window_sync_rendering;
-  impl_class->simulate_key = _gdk_x11_window_simulate_key;
-  impl_class->simulate_button = _gdk_x11_window_simulate_button;
   impl_class->get_property = _gdk_x11_window_get_property;
   impl_class->change_property = _gdk_x11_window_change_property;
   impl_class->delete_property = _gdk_x11_window_delete_property;